﻿using FastMember;

namespace System
{
    public static class ObjectExtensions
    {
        public static readonly object Empty = new object();

        public static object FastGetProperty(this object instance, string prop)
        {
            try
            {
                return ObjectAccessor.Create(instance)[prop];
            }
            catch (Exception)
            {
                return Empty;
            }
        }
    }
}